package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import org.come.Frame.TestChildJframe;
import org.come.Jpanel.TestChildCardJpanel;
import org.come.until.CutButtonImage;

import com.updateNew.MyIsif;

public class ChoseChildTypeMouslisten implements MouseListener {

    private TestChildCardJpanel childCardJpanel;
    private int type;

    public ChoseChildTypeMouslisten(int type, TestChildCardJpanel childCardJpanel) {

        this.type = type;
        this.childCardJpanel = childCardJpanel;

    }

    @Override
    public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent e) {

        try {
            if("水墨UI".equals(MyIsif.getStyle())) {
                if (type == 1) {
                    childCardJpanel.getCar().show(childCardJpanel, "l1");
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabAttr()
                            .setIcons(CutButtonImage.cuts("skin/8100226/button/B180.png"));
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabTalent()
                            .setIcons(CutButtonImage.cuts("skin/8100226/button/B181.png"));
                }
                if (type == 2) {
                    childCardJpanel.getCar().show(childCardJpanel, "l2");
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabAttr()
                            .setIcons(CutButtonImage.cuts("skin/8100226/button/B179.png"));
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabTalent()
                            .setIcons(CutButtonImage.cuts("skin/8100226/button/B182.png"));
                }
            }else{
                if (type == 1) {
                    childCardJpanel.getCar().show(childCardJpanel, "l1");
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabAttr()
                            .setIcons(CutButtonImage.cuts("inkImg/hongmu/2/childattr_checked.png"));
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabTalent()
                            .setIcons(CutButtonImage.cuts("inkImg/hongmu/2/childtalent_unchecked.png"));
                }
                if (type == 2) {
                    childCardJpanel.getCar().show(childCardJpanel, "l2");
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabAttr()
                            .setIcons(CutButtonImage.cuts("inkImg/hongmu/2/childattr_unchecked.png"));
                    TestChildJframe.getTestChildJframe().getTestChildJpanel().getLabTalent()
                            .setIcons(CutButtonImage.cuts("inkImg/hongmu/2/childtalent_checked.png"));
                }
            }

        } catch (Exception e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
    }

    @Override
    public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

}
